Recently, a magnetic random access memory (MRAM) using a magnetic tunnel junction (MTJ) element as a memory element has been attracting attention. The MTJ element used for the MRAM is constituted by three thin films, i.e., a storage layer and a reference layer formed of a magnetic material and a barrier layer (insulating layer) sandwiched therebetween. The MTJ element stores data by the magnetization state of the storage layer. In a spin injection MRAM using spin injection magnetization inversion technology, data is written to an MTJ element by energizing the MTJ element in a direction perpendicular to a film surface of the MTJ element.